/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vzone.bank;

import java.util.List;
import java.util.UUID;
import vzone.structs.BasePeople;
import vzone.structs.Billing;
import vzone.structs.OperatorCode;

/**
 *银行前台服务接口
 * @author Kingpro
 */
public interface IBank
{

    /**
     *建立账户
     * 银行应根据提供的信息向社区调用个人记录 若记录无误则建立账户 返回账户ID 否则返回null
     *
     * @param people 建立账户的客户
     * @param passwordHashS 账户密码hash
     * @return 账户UUID
     */
    public UUID CreateAccount(BasePeople people, String passwordHashS);

    /**
     * 注销账户 此方法暂时可以不实现
     * @param accountIdUuid 注销账户的ID
     * @param passwordHashS 账户密码
     * @return 操作码
     */
    public OperatorCode CancelAccount(UUID accountIdUuid, String passwordHashS);

    /**
     * 修改账户密码
     * @param accountIdUuid 账户ID
     * @param oldPwdS 旧密码hash
     * @param newPwdS 新密码hash
     * @return 操作码
     */
    public OperatorCode ChangePassword(UUID accountIdUuid, String oldPwdS, String newPwdS);

    /**
     * 获取账户客户信息
     * @param accountId 账户ID
     * @param pwd 账户密码
     * @param people 账户客户信息
     * @return 操作码
     */
    public OperatorCode GetAccountPeople(UUID accountId, String pwd, BasePeople people);

    /**
     * 转账服务
     * @param balanceD 需要转账的金额
     * @param fromAccountUuid 转出账户
     * @param fromAccountPwdS 转出账户密码hash
     * @param toAccount  转入账户
     * @return 操作码
     */
    public OperatorCode Transfer(double balanceD, UUID fromAccountUuid, String fromAccountPwdS, UUID toAccount);

    /**
     * 申请贷款
     * 银行应根据其信用记录判断是否受理贷款
     * 
     * @param balanceD 申请金额
     * @param accountUuid 申请的账户
     * @param pwdHashS 账户密码hash
     * @return 操作码
     */
    public OperatorCode GetLoan(double balanceD, UUID accountUuid, String pwdHashS);

    /**
     * 获取账户的余额信息
     * @param accountIDUuid 账户ID
     * @param pwdHashS 账户密码hash
     * @param balance 账户余额(按引用传递)
     * @return 操作码
     */
    public OperatorCode GetAccountBalance(UUID accountIDUuid, String pwdHashS, Double balance);

    /**
     * 检查该笔账单是否入账
     * @param billingIDUuid 账单ID
     * @param accountIDUuid 账户ID
     * @param pwdHashS 账户密码 hash
     * @param billing 账单详细信息(返回)
     * @return 操作码
     */
    public OperatorCode CheckInBilling(UUID billingIDUuid, UUID accountIDUuid, String pwdHashS, Billing billing);

    /**
     * 检查该笔账单是否出账
     * @param billingIDUuid 账单ID
     * @param accountIDUuid 账户ID
     * @param pwdHashS 账户密码hash
     * @param billing 账单详细信息(返回)
     * @return 操作码
     */
    public OperatorCode CheckOutBilling(UUID billingIDUuid, UUID accountIDUuid, String pwdHashS, Billing billing);

    /**
     * 列出所有账单
     * @param accountIDUuid 账户ID
     * @param pwdHashS 账户密码hash
     * @param lists 账单列表(返回)
     * @return 操作码
     */
    public OperatorCode ListBilling(UUID accountIDUuid, String pwdHashS, List<Billing> lists);
}
